import 'package:flutter/material.dart';
import "./myIcon.dart";

void main() {
  runApp(
    MaterialApp(
      theme: ThemeData(primarySwatch: Colors.red), // FIXME 没生效
      home: Scaffold(
        appBar: AppBar(title: const Text('你好flutter1')),
        body: const MyApp(),
      ),
    ),
  );
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    // TODO ListView 列表
    return ListView(
      // TODO 垂直
      scrollDirection: Axis.vertical,
      children: <Widget>[
        const ListTile(
          title: Text('首页'),
          leading: Icon(Icons.home),
        ),
        // 分割线
        const Divider(),
        const ListTile(
            title: Text('全部订单'),
            leading: Icon(Icons.assessment, color: Colors.red)),
        const Divider(),
        const ListTile(
          title: Text('待付款'),
          leading: Icon(Icons.payment, color: Colors.green),
          trailing: Icon(Icons.chevron_right_sharp),
        ),
        const Divider(),
        ListTile(
          title: const Text('大学生网游成瘾，人大代表：是时候建立新机制了'),
          leading: Image.network(
              'https://pics0.baidu.com/feed/b21c8701a18b87d6f4a624d7e65f8f351d30fdfc.jpeg@f_auto?token=a913805ab13f52221c6395ed2242e1c2'),
          subtitle: const Text('大学生沉迷网络游戏的问题引起了全国人大代表、研祥高科技控股集团董事局主席陈志列的关注'),
        ),
        const Divider(),
        ListTile(
          title: const Text('大学生网游成瘾，人大代表：是时候建立新机制了'),
          leading: Image.network(
              'https://pics0.baidu.com/feed/b21c8701a18b87d6f4a624d7e65f8f351d30fdfc.jpeg@f_auto?token=a913805ab13f52221c6395ed2242e1c2'),
          subtitle: const Text('大学生沉迷网络游戏的问题引起了全国人大代表、研祥高科技控股集团董事局主席陈志列的关注'),
        ),
        const Divider(),
        Container(
          padding: const EdgeInsets.fromLTRB(0, 6, 0, 0),
          height: 40,
          child: const Text(
            '我是一个标题',
            textAlign: TextAlign.center,
            style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),
          ),
        ),
        Image.network('https://picsum.photos/400'),
        Container(
          padding: EdgeInsets.fromLTRB(0, 6, 0, 0),
          height: 40,
          child: const Text(
            '我是一个标题',
            textAlign: TextAlign.center,
            style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),
          ),
        ),
        Image.network('https://picsum.photos/400'),
      ],
    );
  }
}
